package com.szcinda.fitness.dto;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
public class CoachDto implements Serializable {
    private String id;
    private String openId;
    private String avatarUrl;//微信头像
    private String name;
    private String nickName;
    private String phone;
    private String fitnessPicSrc;//教练列表显示的健身封面图片
    private List<String> skills = new ArrayList<>();
    private String about;
    private List<String> certificates = new ArrayList<>();

    private int traineeCount;
    private int coachVideoCount;

    public void setSkills(String skills) {
        String[] skillArr = skills.split(",|，");
        this.skills.addAll(Arrays.asList(skillArr));
    }

    public void setCertificates(String certificates) {
        String[] certificateArr = certificates.split(",|，");
        this.certificates.addAll(Arrays.asList(certificateArr));
    }
}
